#ifndef _PIGOS_CACHE_H_
#define _PIGOS_CACHE_H_

#include <type.h>
#include "fs.h"
#include "process.h"

struct cache {
	u32_t	bn;
	u8_t	count;
	u8_t	dirty;
	u8_t	*buf;
	struct process	*wait;
	struct cache	*hash_next, *hash_prev;
	struct cache	*mru_next, *mru_prev;
};

struct cache *get_block(u32_t bn, int flag);
void release_block(struct cache *p, int dirty);
void flush(void);
void init_cache(void);

#endif /* _PIGOS_CACHE_H_ */
